home *** CD-ROM | disk | FTP | other *** search
/ PC Open 102 / PC Open 102 CD 1.bin / CD1 / INTERNET / EMAIL / pop file / setup.exe / popfile.pl < prev    next >
Encoding:
Perl Script  |  2004-07-28  |  2.4 KB  |  78 lines

  1. #!/usr/bin/perl
  2. # ----------------------------------------------------------------------------
  3. #
  4. # popfile.pl --- Message analyzer and sorter
  5. #
  6. # Acts as a server and client designed to sit between a real mail/news
  7. # client and a real mail/ news server using POP3.  Inserts an extra
  8. # header X-Text-Classification: into the header to tell the client
  9. # which category the message belongs in and much more...
  10. #
  11. # Copyright (c) 2001-2004 John Graham-Cumming
  12. #
  13. #   This file is part of POPFile
  14. #
  15. #   POPFile is free software; you can redistribute it and/or modify
  16. #   it under the terms of the GNU General Public License as published by
  17. #   the Free Software Foundation; either version 2 of the License, or
  18. #   (at your option) any later version.
  19. #
  20. #   POPFile is distributed in the hope that it will be useful,
  21. #   but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  23. #   GNU General Public License for more details.
  24. #
  25. #   You should have received a copy of the GNU General Public License
  26. #   along with POPFile; if not, write to the Free Software
  27. #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  28. #
  29. #   Modified by     Sam Schinke (sschinke@users.sourceforge.net)
  30. #
  31. # ----------------------------------------------------------------------------
  32.  
  33. use strict;
  34. use locale;
  35.  
  36. use lib defined($ENV{POPFILE_ROOT})?$ENV{POPFILE_ROOT}:'./';
  37.  
  38. use POPFile::Loader;
  39.  
  40. # POPFile is actually loaded by the POPFile::Loader object which does all
  41. # the work
  42.  
  43. my $POPFile = POPFile::Loader->new();
  44.  
  45. # Indicate that we should create output on STDOUT (the POPFile
  46. # load sequence) and initialize with the version
  47.  
  48. $POPFile->debug(1);
  49. $POPFile->CORE_loader_init();
  50.  
  51. # Redefine POPFile's signals
  52.  
  53. $POPFile->CORE_signals();
  54.  
  55. # Create the main objects that form the core of POPFile.  Consists of
  56. # the configuration modules, the classifier, the UI (currently HTML
  57. # based), platform specific code, and the POP3 proxy.  The link the
  58. # components together, intialize them all, load the configuration from
  59. # disk, start the modules running
  60.  
  61. $POPFile->CORE_load();
  62. $POPFile->CORE_link_components();
  63. $POPFile->CORE_initialize();
  64. if ( $POPFile->CORE_config() ) {
  65.     $POPFile->CORE_start();
  66.  
  67.     # This is the main POPFile loop that services requests, it will
  68.     # exit only when we need to exit
  69.  
  70.     $POPFile->CORE_service();
  71.  
  72.     # Shutdown every POPFile module
  73.  
  74.     $POPFile->CORE_stop();
  75. }
  76.  
  77. # END
  78.